package com.dms.modules.order.dto;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.validation.Valid;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import java.math.BigDecimal;
import java.util.List;

@Data
@ApiModel(value = "OrderDTO对象", description = "订单数据传输对象")
public class OrderDTO {

    @ApiModelProperty("订单ID")
    private Long id;

    @ApiModelProperty("用户ID")
    @NotNull(message = "用户ID不能为空")
    private Long userId;

    @ApiModelProperty("店铺ID")
    @NotNull(message = "店铺ID不能为空")
    private Long shopId;

    @ApiModelProperty("订单总金额")
    private BigDecimal totalAmount;

    @ApiModelProperty("实付金额")
    private BigDecimal payAmount;

    @ApiModelProperty("运费")
    private BigDecimal freightAmount;

    @ApiModelProperty("优惠券ID")
    private Long couponId;

    @ApiModelProperty("优惠券抵扣金额")
    private BigDecimal couponAmount;

    @ApiModelProperty("支付方式（1-支付宝，2-微信，3-余额）")
    @NotNull(message = "支付方式不能为空")
    private Integer payType;

    @ApiModelProperty("收货人姓名")
    @NotNull(message = "收货人姓名不能为空")
    private String receiverName;

    @ApiModelProperty("收货人电话")
    @NotNull(message = "收货人电话不能为空")
    private String receiverPhone;

    @ApiModelProperty("收货人地址")
    @NotNull(message = "收货人地址不能为空")
    private String receiverAddress;

    @ApiModelProperty("订单备注")
    private String remark;

    @ApiModelProperty("订单明细列表")
    @NotEmpty(message = "订单明细不能为空")
    @Valid
    private List<OrderItemDTO> orderItems;
} 